<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Gerchberg–Saxton algorithm</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Gerchberg%E2%80%93Saxton_algorithm"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Gerchberg–Saxton_algorithm rootpage-Gerchberg–Saxton_algorithm skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Gerchberg–Saxton algorithm</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p>The <b>Gerchberg–Saxton (GS) algorithm</b> is an iterative <a href="Phase_retrieval" title="Phase retrieval">phase retrieval</a> <a href="Algorithm" title="Algorithm">algorithm</a> for retrieving the phase of a complex-valued wavefront from two intensity measurements acquired in two different planes.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> Typically, the two planes are the image plane and the far field (diffraction) plane, and the wavefront propagation between these two planes is given by the <a href="Fourier_transform" title="Fourier transform">Fourier transform</a>. The original paper by Gerchberg and Saxton considered image and diffraction pattern of a sample acquired in an electron microscope.
</p><p>It is often necessary to know only the phase distribution from one of the planes, since the phase distribution on the other plane can be obtained by performing a Fourier transform on the plane whose phase is known. Although often used for two-dimensional signals, the GS algorithm is also valid for one-dimensional signals.
</p><p>The <a href="Pseudocode" title="Pseudocode">pseudocode</a> below performs the GS algorithm to obtain a phase distribution for the plane "Source", such that its Fourier transform would have the amplitude distribution of the plane "Target".
</p><p>The Gerchberg-Saxton algorithm is one of the most prevalent methods used to create <a href="Computer-generated_hologram" class="mw-redirect" title="Computer-generated hologram">computer-generated holograms</a>.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Pseudocode_algorithm">Pseudocode algorithm</h2></div>
<pre><b>Let:</b>
FT – forward Fourier transform
IFT – inverse Fourier transform
<i>i</i> – the imaginary unit, √−1 (square root of −1)
exp – exponential function (exp(x) = <i>e</i><sup><i>x</i></sup>)
Target and Source be the Target and Source Amplitude planes respectively
A, B, C & D be complex planes with the same dimension as Target and Source
Amplitude – Amplitude-extracting function:
e.g. for complex <i>z</i> = <i>x</i> + <i>iy</i>, amplitude(<i>z</i>) = sqrt(<i>x</i>·<i>x</i> + <i>y</i>·<i>y</i>)
for real <i>x</i>, amplitude(<i>x</i>) = |<i>x</i>|
Phase – Phase extracting function:
e.g. Phase(z) = arctan(y / x)
<b>end Let</b>
<b>algorithm</b> Gerchberg–Saxton(Source, Target, Retrieved_Phase) <b>is</b>
A := IFT(Target)
<b>while</b> error criterion is not satisfied
B := Amplitude(Source) × exp(i × Phase(A))
C := FT(B)
D := Amplitude(Target) × exp(i × Phase(C))
A := IFT(D)
<b>end while</b>
Retrieved_Phase = Phase(A)
</pre>
<p>This is just one of the many ways to implement the GS algorithm. Aside from optimizations, others may start by performing a forward Fourier transform to the source distribution.
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Phase_retrieval" title="Phase retrieval">Phase retrieval</a></li>
<li><a href="Fourier_optics" title="Fourier optics">Fourier optics</a></li>
<li><a href="Holography" title="Holography">Holography</a></li>
<li><a href="Adaptive-additive_algorithm" title="Adaptive-additive algorithm">Adaptive-additive algorithm</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFGerchbergSaxton1972" class="citation journal cs1">Gerchberg, R. W.; Saxton, W. O. (1972). <a rel="nofollow" class="external text" href="https://web.archive.org/web/20160328053000/http://www.u.arizona.edu/~ppoon/GerchbergandSaxton1972.pdf">"A practical algorithm for the determination of the phase from image and diffraction plane pictures"</a> <span class="cs1-format">(PDF)</span>. <i>Optik</i>. <b>35</b>: <span class="nowrap">237–</span>246. Archived from <a rel="nofollow" class="external text" href="http://www.u.arizona.edu/~ppoon/GerchbergandSaxton1972.pdf">the original</a> <span class="cs1-format">(PDF)</span> on March 28, 2016.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite id="CITEREFMemmoloMiccioMerolaPaciello2014" class="citation journal cs1">Memmolo, Pasquale; Miccio, Lisa; Merola, Francesco; Paciello, Antonio; Embrione, Valerio; Fusco, Sabato; Ferraro, Pietro; Antonio Netti, Paolo (2014-01-01). <span class="id-lock-subscription" title="Paid subscription required"><a rel="nofollow" class="external text" href="https://www.sciencedirect.com/science/article/pii/S0143816613001942">"Investigation on specific solutions of Gerchberg–Saxton algorithm"</a></span>. <i>Optics and Lasers in Engineering</i>. <b>52</b>: <span class="nowrap">206–</span>211. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1016%2Fj.optlaseng.2013.06.008">10.1016/j.optlaseng.2013.06.008</a>. <a href="ISSN_(identifier)" class="mw-redirect" title="ISSN (identifier)">ISSN</a> <a rel="nofollow" class="external text" href="https://search.worldcat.org/issn/0143-8166">0143-8166</a>.</cite></span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li>Dr W. Owen Saxton's pages <a rel="nofollow" class="external autonumber" href="http://www-hrem.msm.cam.ac.uk/people/saxton/">[1]</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20080613024950/http://www-hrem.msm.cam.ac.uk/people/saxton/">Archived</a> 2008-06-13 at the <a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a>, <a rel="nofollow" class="external autonumber" href="https://www.murrayedwards.cam.ac.uk/fellows/dr-w-owen-saxton">[2]</a></li>
<li><a rel="nofollow" class="external text" href="http://www.optics.rochester.edu/workgroups/fienup/index.html">Applications and publications on phase retrieval from the University of Rochester, Institute of Optics</a></li>
<li><a rel="nofollow" class="external text" href="https://www.creatgraphy.com/05/2020/allgemein/lightmodulation-gerchberg-saxton-algorithmus-gsa-660/">A Python-Script of the GS by Dominik Doellerer</a></li>
<li>MATLAB GS algorithms <a rel="nofollow" class="external autonumber" href="https://ch.mathworks.com/matlabcentral/fileexchange/68647-gerchberg-saxton-phase-retrieval-algorithm/">[3]</a>, <a rel="nofollow" class="external autonumber" href="https://ch.mathworks.com/matlabcentral/fileexchange/65979-gerchberg-saxton-algorithm">[4]</a></li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-05-21" href="https://en.wikipedia.org/wiki/?title=Gerchberg%E2%80%93Saxton_algorithm&oldid=1291497070">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>